package sit.mycatalog.web.util;

import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class AbstractMBean {
	protected String getParameter(String p_strParameterName) {
		HttpServletRequest request = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
		return request.getParameter(p_strParameterName);
	}
	
	protected Object getSessionAttribute(String p_strattributeName) {
		HttpSession session = (HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(true);
		return session.getAttribute(p_strattributeName);
	}
	
	protected void message(String p_strMessage) {
		FacesUtils.addInfoMessage(p_strMessage);
	}
}
